<template>
  <div class="container">
    <div class="header">
      <div class="title">视频监控</div>      
    </div>
    <div class="content" @click="handleClick('navigationlock')">
      <div class="icon">
        <img src="../../static/images/navigationlock-icon.png" alt="">       
      </div>
      <div class="name">船闸视频<img src="../../static/images/arrow-icon.png" alt=""></div>
      <img src="../../static/images/navigationlock.png" alt="" class="bg">
    </div>
    <div class="content" @click="handleClick('overwater')">
      <div class="icon">        
        <img src="../../static/images/overwater-icon.png" alt="">        
      </div>
      <div class="name">水上视频<img src="../../static/images/arrow-icon.png" alt=""></div>
      <img src="../../static/images/overwater.png" alt="" class="bg">
    </div>
    <div class="source">
      <div class="name">广东省交通运输厅</div>
      <div class="name">数据来源：广东省航道事务中心</div>
    </div> 
  </div>
</template>

<script setup>
import { onMounted, ref } from "vue";
  import { useRouter } from "vue-router";
  const router = useRouter();
  const handleClick = (type) => {
    router.push({
      path: "/videoList",
      query: {
        type: type
      }
    });
  };

  onMounted(() =>{
    if(sessionStorage.getItem("watermarkTxt")){
      //加水印
      watermark.init({ 
        watermark_x: -30, // 水印起始位置x轴坐标
        watermark_y: -20, // 水印起始位置Y轴坐标
        watermark_x_space: 20, // 水印x轴间隔
        watermark_y_space: 80, // 水印y轴间隔
        watermark_alpha: 0.07, // 水印透明度
        watermark_fontsize: '14px', // 水印字体大小
        watermark_width: 100, // 水印宽度
        watermark_height: 30,
        watermark_txt: sessionStorage.getItem("watermarkTxt"), // 水印的内容
        watermark_angle: 25, // 水印倾斜度数
        watermark_rows: 0, // 水印行数
        watermark_cols: 0, // 水印列数
        watermark_font: '微软雅黑', // 水印字体
        watermark_color: 'black', // 水印字体颜色 
      });
    }
  });
</script>

<style lang="scss" scoped>
  .container{
    width: 100%;
    overflow: hidden;
    .header{
      display: flex;
      align-items: center;
      // justify-content: space-between;
      background-color: #fff;
      box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.08);
      .title {
        color: #262626;
        font-size: 18px;
        font-weight: 500;
        padding: 12px 0px 10px 20px;
        position: relative;
      }
    }
    .content{
      height: 163px;
      margin: 24px 20px;
      position: relative;
      .bg{
        width: 100%;
        height: 100%;
      } 
      .icon{
        width: 48px;
        height: 48px;
        position: absolute;
        margin: 24px 0px 12px 24px;
        img{
          width: 100%;
          height: 100%;
        }        
      }
      .name{
        display: flex;
        align-items: center;
        position: absolute;
        margin: 78px 0px 12px 24px;
        font-size: 24px;
        font-weight: 500;
        color: #FFFFFF;
        img{
          margin-left: 10px;
        }        
      }
    }
    .source{
      color: #8C8C8C;
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translate(-50%,-50%);
      .name{
        margin-bottom: 5px;
        text-align: center;
      }
    }
  }
</style>